<html xmlns:th="http://www.thymeleaf.org">
<head>
    <link type="text/css" href="/topjui/css/myui.css" rel="stylesheet"/>
</head>
<body>
<form id="customerform" method="post" style="padding-top:1px">
<input type="hidden" id="id" name="id" value="0">
<table class="editTable">
    <tr>
        <td class="label">控制编号</td>
        <td>
            <input type="text" name="simno"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
        <td class="label">车辆编号</td>
        <td>
            <input type="text" name="carno"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">车辆牌照</td>
        <td>
            <input type="text" name="plateno"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
        <td class="label">所属车队</td>
        <td>
            <input type="hidden" class="easyui-validatebox" data-options="required:true" id="form-fleetid" name="fleetid" value="0" >
            <input type="hidden" class="easyui-validatebox" data-options="required:true" id="form-fleetname" name="fleetname" value="" >
            <input class="selectp"  type="text" name="fleet" id="form-fleet">
        </td>
    </tr>
    <tr>
        <td class="label">通讯方式</td>
        <td>
            <input class="selectp"  type="text" name="commode" id="form-commode">
        </td>
        <td class="label">协议类型</td>
        <td>
            <input class="selectp"  type="text" name="protocol" id="form-protocol">
        </td>
    </tr>
    <tr>
        <td class="label">定位方式</td>
        <td>
            <input class="selectp"  type="text" name="position" id="form-position">
        </td>
        <td class="label">车辆类型</td>
        <td>
            <input class="selectp"  type="text" name="cartype" id="form-cartype">
        </td>
    </tr>
    <tr>
        <td class="label">车辆归属</td>
        <td>
            <input type="text" name="carown"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
        <td class="label">总公里数</td>
        <td>
            <input type="text" name="runtotal"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">保险日期</td>
        <td>
            <input type="text" id="form-safetime" name="safetime"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
        <td class="label">年检日期</td>
        <td>
            <input type="text" id="form-stoptime" name="stoptime"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
    </tr>
    <tr>
        <td class="label">车辆限速</td>
        <td>
            <input type="text" name="limitspeed"  class="inputp" autocomplete="off" data-options="required:true" style="width: 211px;">
        </td>
        <td class="label">状态</td>
        <td>
            <select name="status" style="width: 240px;" class="selectp">
                <option value="1">正常</option>
                <option value='0'>禁用</option>
            </select>
        </td>
    </tr>
</table>
<script th:inline="javascript">
    $(function () {
        $('#form-safetime').datebox({
            formatter: function (date) {

                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                var d = date.getDate();
                return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);

            }
        });

        $('#form-stoptime').datebox({
            formatter: function (date) {

                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                var d = date.getDate();
                return y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d);

            }
        });

        $('#form-fleet').combotree({
            width: 212,
            height: 32,
            style: "width:212px;height:32px;",
            cls: 'selectp',
            panelWidth: 212,
            hasDownArrow: true,
            url: '/fleet/all',
            required: true,
            onSelect: function (data) {
                $("#form-fleetid").val(data.id);
                $("#form-fleetname").val(data.text);
            }
        });

        $('#form-commode').combotree({
            width: 212,
            height: 32,
            style: "width:212px;height:32px;",
            cls: 'selectp',
            panelWidth: 212,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=commode',
            required: true,
            onSelect: function (data) {
                $("#form-commode").val(data.text);
            }
        });

        $('#form-protocol').combotree({
            width: 212,
            height: 32,
            style: "width:212px;height:32px;",
            cls: 'selectp',
            panelWidth: 212,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=protocol',
            required: true,
            onSelect: function (data) {
                $("#form-protocol").val(data.text);
            }
        });

        $('#form-position').combotree({
            width: 212,
            height: 32,
            style: "width:212px;height:32px;",
            cls: 'selectp',
            panelWidth: 212,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=position',
            required: true,
            onSelect: function (data) {
                $("#form-position").val(data.text);
            }
        });

        $('#form-cartype').combotree({
            width: 212,
            height: 32,
            style: "width:212px;height:32px;",
            cls: 'selectp',
            panelWidth: 212,
            hasDownArrow: true,
            url: '/sys/groupsText?groups=cartype',
            required: true,
            onSelect: function (data) {
                $("#form-cartype").val(data.text);
            }
        });

        $(".combo-text").removeAttr("style");
        $(".combo-text").attr("style", "width:212px;height:32px;line-height:32px");
        $(".combo-text").addClass("selectp");
        $(".combo-arrow").attr("style", "margin-left: -20px;margin-top: 8px;background-color:rgba(0,0,0,0)");
        $(".combo-panel").attr("style", "margin-top:10px;");
    })

</script>
</form>
</body>
</html>